package priv.stones.collections.list;

import java.util.Enumeration;
import java.util.List;
import java.util.ListIterator;
import java.util.Vector;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017/11/4 22:26
 */
public class Vector1 {

    public static void main(String[] args) {

        Vector<String> data = new Vector<String>();
        data.add("test1");
        data.add("test2");
        data.add("test3");
        data.add("test4");
        data.add("test1");
        System.out.println(data);

        ListIterator<String> listIterator = data.listIterator();

//        while (listIterator.hasNext()) {
//            System.out.println(listIterator.next());
//        }
//        System.out.println("\n\n    倒过来  ");
//
//        while (listIterator.hasPrevious()) {
//            System.out.println(listIterator.previous());
//        }


        Enumeration<String> enumeration = data.elements();
        while (enumeration.hasMoreElements()) {
            System.out.println(enumeration.nextElement());
        }


    }

}
